package com.lanou.dllo.mynovel.fragment;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.lanou.dllo.mynovel.R;
import com.lanou.dllo.mynovel.activity.EntryActivity;
import com.lanou.dllo.mynovel.tools.MyImageView;

/**
 * Created by dllo on 15/10/27.
 */
public class UserFragment extends Fragment implements View.OnClickListener {

    private MyImageView myImageView;
    private Button entryBtn;
    private View entry_yuepiao, entry_buys, entry_beVip, entry_topUp;


    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_user, null);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);


        entryBtn = (Button) view.findViewById(R.id.entryBtn);
        entryBtn.setOnClickListener(this);

        entry_yuepiao = view.findViewById(R.id.entry_yuepiao);
        entry_yuepiao.setOnClickListener(this);

    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.entryBtn:
                toEntry();
                break;
            case R.id.entry_yuepiao:
                toEntry();
                break;
        }
    }

    public void toEntry() {
        Intent intent = new Intent(getActivity(), EntryActivity.class);
        startActivity(intent);
//        getActivity().finish();
    }
}
